home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS Toolkit
/
BBS Toolkit.iso
/
wildcat
/
logtrim.zip
/
LOGTRIM.DOC
< prev
next >
Wrap
Text File
|
1992-01-26
|
4KB
|
106 lines
LOGTRIM version 3.03 released 1/26/92
A public domain utility for Wildcat! Sysops
by Michael Conley, Sysop
The Charlatan's Cabin
(213) 654-7337
WHAT IT DOES:
=============
LOGTRIM is a generic LOG file trimmer which will scan any ASCII log
and delete all file lines until it encounters a user specified date.
Suggested applications include the Wildcat! ACTIVITY.LOG and the
TNet TNET.LOG, as well as virtually ANY ASCII chronological log. The
file extension ".LOG" is required on the file you're going to trim.
HOW TO USE IT:
==============
LOGTRIM may be used interactively, or from the command line, or in a batch
file.
First, log into the directory where your .LOG file exists. Next, invoke
LOGTRIM. The first screen will ask for the file name of the LOG, and the
number of days to keep. It will calculate based upon the current system
date and then trim the log, keeping entries on or after the specified date.
If the specified date is NOT found, no action is taken and the log is
left intact.
If the LOG file is trimmed, you'll find that the original has been saved
with the extension '.BAK' in the event LOGTRIM should do something terrible
to your file. (Not likely, but I like to be safe.)
Using LOGTRIM from a batch file (or directly from the command line) involves
specifying two items on the command line. These are the NAME of the log file
and the NUMBER of days to keep (any value between 2 and 365 is acceptable.)
For example:
LOGTRIM ACTIVITY 15
would keep all entries within the past 15 days. Incidentally, LOGTRIM will
search for either the '/' or the '-' separator in dates, so a log file that
refers to the date as MM/DD/YY or MM-DD-YY would be parsed identically.
Beginning with version 3.02, LOGTRIM will automatically test for any of 12
date formats: MM-DD-YY, MM/DD/YY, MM-DD-YYYY, MM/DD/YYYY,
or low month: M-DD-YY, M/DD/YY, M-DD-YYYY, M/DD/YYYY, or
the European: YY-MM-DD, YY/MM/DD, YYYY-MM-DD, YYYY/MM/DD.
If your log file happens to show the date in another format, LOGTRIM
won't work.
The program requires no user interaction and will exit upon conclusion,
even if the log file isn't found or the date is not matched.
USE WITH WCPRO!:
Here's a suggestion. If you use WCPRO! to produce a STATISTICS file, you may
have noticed it can optionally maintain internal .HST (history) files and
delete the ACTIVITY.### files after it runs. I like to run it in this mode,
but I don't like having the
ACTIVITY.LOG tossed out each night before I get a chance to review it.
This is a clip from my nightly BBS Maintenance batch file which lets you
append the log onto a backup copy before running WCPRO! Then you may
use LOGTRIM to keep the backup copy from getting out of hand.
BATCH FILE EXAMPLE:
IF EXIST \BACKUP\ACTIVITY.OLD DEL \BACKUP\ACTIVITY.OLD
REN \BACKUP\ACTIVITY.LOG \BACKUP\ACTIVITY.OLD
COPY \BACKUP\ACTIVITY.OLD+\CAT\ACTIVITY.LOG \BACKUP\ACTIVITY.LOG
WCPRO! ... (include whatever command line options you wish)
CD \BACKUP
LOGTRIM ACTIVITY 15
CD \CAT
.......
In this example, you are preserving a copy of your activity log in a
directory called \BACKUP. First, you delete any existing copy of
\BACKUP\ACTIVITY.OLD, and then you REName \BACKUP\ACTIVITY.LOG to
\BACKUP\ACTIVITY.OLD. Next you write a new \BACKUP\ACTIVITY.LOG
containing first \BACKUP\ACTIVITY.OLD followed by your current ACTIVITY.LOG
from the \CAT directory.
Now, you may run WCPRO!, which will delete ACTIVITY.LOG upon conclusion
of its run.
Finally, you change directory to \BACKUP, and run LOGTRIM, specifying a
15-day-holding period. This keeps the backup log from getting too large,
but you always have the past 15 days should you need to refer to it.
LOGTRIM is contributed to the public domain by Michael A. Conley, with
the understanding that it may be freely distributed without limitation
except that it may not be offered for sale.
Comments and suggestions are welcome ... please call the
Charlatan's Cabin BBS at (213) 654-7337. If you're a registered
Wildcat! SysOp, leave a Comment to the SysOp indicating this, and
include your Wildcat! registration number, and I'll upgrade you to
member level access without the bother of registration by mail.